﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace easy_app
{
    public partial class Form1 : Form , IView
    {
        public Form1()
        {
            InitializeComponent();
        }

        public event EventHandler<EventArgs> previousButtonPressed;
        public event EventHandler<EventArgs> nextButtonPressed;
        public event EventHandler<EventArgs> saveButtonPressed;

        public void SetName(string text)
        {
            nameTextBox.Text=text;
        }

        public void SetSurName(string text)
        {
            surnameTextBox.Text = text;
        }

        private void previousButton_Click(object sender, EventArgs e)
        {
            if (previousButtonPressed != null)
                previousButtonPressed(this, EventArgs.Empty);
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
            if(saveButtonPressed != null)
                saveButtonPressed(this, EventArgs.Empty);
        }

        private void nextButton_Click(object sender, EventArgs e)
        {
            if (nextButtonPressed != null)
                nextButtonPressed(this, EventArgs.Empty);

        }

        public string GetName()
        {
            return nameTextBox.Text;
        }

        public string GetSurName()
        {
            return surnameTextBox.Text;
        }
    }
}
